/*
 * Copyright (c) 2018-2999 九五云信息科技有限公司 All rights reserved.
 *
 * https://www.gz-yami.com/
 *
 * 未经允许，不可做商业用途！
 *
 * 版权所有，侵权必究！
 */

package com.yami.shop.bean.model;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.Version;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.yami.shop.bean.param.LiveRoomParam;
import com.yami.shop.common.serializer.json.ImgJsonSerializer;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

@Data
@TableName("yy_prod")
@ApiModel(value = "商品信息", description = "商品的基本信息")
public class Product implements Serializable {

    private static final long serialVersionUID = -4644407386444894349L;


    /**
     * 我后期家的字段
     */
    /**
     * 商品链接状态
     */
    @ApiModelProperty(value = "商品链接状态0为关闭 1为开启", example = "1")
    private Integer linkStatus;
    /**
     * 代理价格
     */
    @ApiModelProperty(value = "代理价格", example = "99.99")
    private Double proxyPrice;
    /**
     * 代理最低价格
     */
    @ApiModelProperty(value = "代理最低价格", example = "89.99")
    private Double proxyFarePrice;

    /**
     * 售后日期
     */
    @ApiModelProperty(value = "售后日期", example = "2023-01-01 00:00:00")
    private Date salesDate;
    /**
     * 是否代理 0为否
     */
    @ApiModelProperty(value = "是否代理(0:否 1:是)", example = "1")
    private Integer isProxy;

    /**
     * 选号费用
     */
    @ApiModelProperty(value = "选号费用", example = "10.00")
    private Double selectionFee;


    /**
     * 是否通知u
     */
    @ApiModelProperty(value = "是否通知(0:否 1:是)", example = "1")
    private Integer isNotification;
    /**
     * 通知方式
     */
    @ApiModelProperty(value = "通知方式", example = "1.0")
    private Double notificationMethod;
    /**
     * 库存预警
     */
    @ApiModelProperty(value = "库存预警", example = "10.0")
    private Double lnventoryAlerts;

//    /**
//     * 销量
//     */
//    @ApiModelProperty(value = "销量", example = "10")
//    private Integer sale;
    /**
    /**
     * 密码
     */
    @ApiModelProperty(value = "密码", example = "123456")
    private String password;
    /**
     * 是否设置密码
     */
    @ApiModelProperty(value = "是否设置密码", example = "1")
    private String isPassword;
    /**
     * 售卡顺序
     */
    @ApiModelProperty(value = "售卡顺序", example = "1,2,3")
    private String cardSales;

    /**
     * 是否开启优惠券
     */
    @ApiModelProperty(value = "是否开启优惠券(0:否 1:是)", example = "1")
    private Integer isCoupons;
    /**
     * 是否开启优惠券
     */
    @ApiModelProperty(value = "配送方式", example = "1")
    private Integer shippingMethod;
    /**
     * 91三方卡券id
     */
    @ApiModelProperty(value = "91三方卡券id", example = "card123456")
    private String couponsNeneoneId;

    /**
     * 限购数量
     */
    @ApiModelProperty(value = "限购数量", example = "5.0")
    private Double purchaseLimit;



    /**
     * 我后期家的字段结束
     */

//    我后期注掉的字段
    /**
     * 在店铺当中的分类id
     */
    @ApiModelProperty(value = "店铺分类ID", example = "1")
    private Long shopCategoryId;

    /**
     * 在店铺当中的分类名称
     */
    @ApiModelProperty(value = "店铺分类名称", example = "测试分类")
    @TableField(exist = false)
    private String categoryName;
    /**
     * 配送方式json
     */
//    @ApiModelProperty(value = "配送方式JSON", example = "{\"hasUserPickUp\":true,\"hasShopDelivery\":true}")
    private String deliveryMode;
    /**
     * 活动id(对应prod_type)
     */
    @ApiModelProperty(value = "活动ID", example = "1")
    private Long activityId;
    /**
     * 预售状态 1：开启 0：未开启
     */
//    @ApiModelProperty(value = "预售状态(0:未开启 1:开启)", example = "1")
    private Integer preSellStatus;
//    /**
//     * 商品视频
//     */
////    @JsonSerialize(using = ImgJsonSerializer.class)
//    @ApiModelProperty(value = "商品视频", example = "https://example.com/video.mp4")
//    private String video;
    /**
     * 运费模板id
     */
//    @ApiModelProperty(value = "运费模板ID", example = "1")
    private Long deliveryTemplateId;
//    /**
//     * 商品积分价格
//     */
//    @ApiModelProperty(value = "商品积分价格", example = "100")
//    private Integer scorePrice;

//    我后期注掉的字段结束

    /**
     * 商品ID
     */
    @TableId
    @ApiModelProperty(value = "商品ID", example = "1")
    private Long prodId;

    /**
     * 店铺id
     */
    @ApiModelProperty(value = "店铺ID", example = "1")
    private Long shopId;

    /**
     * 在平台当中的分类id
     */
    @ApiModelProperty(value = "平台分类ID", example = "1")
    private Long categoryId;


    /**
     * 商品名称
     */
    @ApiModelProperty(value = "商品名称", example = "iPhone 13")
    private String prodName;
    /**
     * 详细描述
     */
    @ApiModelProperty(value = "详细描述", example = "<p>商品详情HTML内容</p>")
    private String content;
    /**
     * 简要描述,卖点等
     */
    @ApiModelProperty(value = "简要描述", example = "最新款iPhone手机")
    private String brief;
    /**
     * 原价
     */
    @ApiModelProperty(value = "成本价", example = "5999.0")
    private Double oriPrice;

    /**
     * 现价
     */
    @ApiModelProperty(value = "现价", example = "5499.0")
    private Double price;

    /**
     * 商品主图
     */
    @JsonSerialize(using = ImgJsonSerializer.class)
    @ApiModelProperty(value = "商品主图", example = "https://example.com/image.jpg")
    private String pic;

    /**
     * 商品图片
     */
    @ApiModelProperty(value = "商品图片", example = "https://example.com/image1.jpg,https://example.com/image2.jpg")
    private String imgs;

    /**
     * 默认是1，表示正常状态, -1表示删除, 0下架
     */
    @ApiModelProperty(value = "商品状态(1:正常 0:下架 -1:删除)", example = "1")
    private Integer status;

    /**
     * 品牌Id
     */
    @ApiModelProperty(value = "品牌ID", example = "1")
    private Long brandId;

    /**
     * 已经销售数量
     */
    @ApiModelProperty(value = "已售数量", example = "100")
    private Integer soldNum;

    /**
     * 库存量
     */
    @ApiModelProperty(value = "总库存", example = "1000")
    private Integer totalStocks;



    /**
     * 录入时间
     */
    @ApiModelProperty(value = "创建时间", example = "2023-01-01 00:00:00")
    private Date createTime;

    /**
     * 修改时间
     */
    @ApiModelProperty(value = "更新时间", example = "2023-01-01 00:00:00")
    private Date updateTime;


    /**
     * 上架时间
     */
    @ApiModelProperty(value = "上架时间", example = "2023-01-01 00:00:00")
    private Date putawayTime;

    /**
     * 商品类型(0为虚拟商品 1为实物商品)
     */
    @ApiModelProperty(value = "商品类型(0:虚拟商品 1:实物商品)", example = "1")
    private Integer prodType;




    /**
     * 预售发货时间
     */
    @ApiModelProperty(value = "预售发货时间", example = "2023-01-10 00:00:00")
    private Date preSellTime;
    /**
     * 是否为组合商品，0普通商品，1组合商品
     */
    @ApiModelProperty(value = "是否组合商品(0:普通商品 1:组合商品)", example = "0")
    private Integer isCompose;
    /**
     * 版本
     */
    @Version
    @ApiModelProperty(value = "版本号", example = "1")
    private Integer version;

    /**
     * 事件状态
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "事件状态", example = "1")
    private Integer eventStatus;
    /**
     * 语言列表信息
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "语言列表信息")
    private List<ProdLang> prodLangList;
    /**
     * 品牌
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "品牌信息")
    private Brand brand;

    /**
     * sku列表
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "SKU列表")
    private List<Sku> skuList;

    /**
     * 店铺名称
     */
    @TableField(exist = false)
    @ApiModelProperty(value = "店铺名称", example = "Apple官方旗舰店")
    private String shopName;

    /**
     * 商品直播间列表
     */
    @ApiModelProperty(value = "商品直播间列表")
    @TableField(exist = false)
    private List<LiveRoomParam> liveRoomParams;

    @Data
    @ApiModel(value = "配送方式", description = "商品配送方式信息")
    public static class DeliveryModeVO {
        /**
         * 用户自提
         */
        @ApiModelProperty(value = "用户自提", required = true, example = "true")
        private Boolean hasUserPickUp;

        /**
         * 店铺配送
         */
        @ApiModelProperty(value = "店铺配送", required = true, example = "true")
        private Boolean hasShopDelivery;

        /**
         * 同城配送
         */
        @ApiModelProperty(value = "同城配送", required = true, example = "true")
        private Boolean hasCityDelivery;

    }
}
